Frame size made dynamic and bugs fixing