Made resize directive more generic