Made modal directive more robust and modified modal styles